package com.rfid.spec;

public class SpecInvenParamSet
        extends Spec {
  public SpecAirProtocInvenParam m_AirProtocolParams = null;
  public SpecTagAccessSet m_TagAccessSetList = null;
  public SpecStopTrigger m_StopTrigger = new SpecStopTrigger();



  public static SpecInvenParamSet Create() { return new SpecInvenParamSet(); }



  public boolean AddAirProtocol(SpecAirProtocInvenParam AirProt) {
    if (AirProt != null) {

      AirProt.m_next = this.m_AirProtocolParams;
      this.m_AirProtocolParams = AirProt;
    }

    return true;
  }


  public boolean AddTagAccessSet(SpecTagAccessSet tagAccessSet) {
    if (tagAccessSet != null) {

      tagAccessSet.m_next = this.m_TagAccessSetList;
      this.m_TagAccessSetList = tagAccessSet;
    }
    return true;
  }


  public SpecAirProtocInvenParam GetAirProtocolInvnParam(long aipID) {
    SpecAirProtocInvenParam p = this.m_AirProtocolParams;
    while (p != null) {

      if (p.m_aipType == aipID)
      {
        return p;
      }
      p = (SpecAirProtocInvenParam)p.m_next;
    }

    return null;
  }



  public SpecTagAccessSet GetTagAccessSet(long AIP, long tagID) {
    SpecTagAccessSet p = this.m_TagAccessSetList;
    while (p != null) {

      if (p.m_AIP == AIP && p.m_TID == tagID)
      {
        return p;
      }
      p = (SpecTagAccessSet)p.m_next;
    }
    return null;
  }
}
